package com.xzr2;

import java.util.Scanner;

public class BankMain {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        ConstructionBank bank1 = new ConstructionBank();
        BankOfDalian bank2 = new BankOfDalian();

        System.out.println("存款金额(元):");
        bank1.savedMoney = sc.nextInt();
        bank2.savedMoney = bank1.savedMoney;
        System.out.println("建设银行存款利率：");
        bank1.rate = sc.nextDouble();
        System.out.println("存款时长:");
        bank1.year = sc.nextDouble();
        bank2.year = bank1.year;

        bank1.computerInterest();
        System.out.println("大连银行存款利率：");
        bank2.rate = sc.nextDouble();
        bank2.computerInterest();
        System.out.println("两家银行利息相差：" + Math.abs(bank1.interest - bank2.interest) + "元");

    }
}
